<?php
header('Content-Type:text/html; charset=UTF-8');
session_start();
if (empty($_SESSION['user'])) {
    header('location:dl.php');
    exit();
}
@$tjcplx = $_POST['tjcplx'];
$pdo = new PDO('mysql:dbname=dcxt;charset=utf8', 'root');
if ($tjcplx != null) {
    $s = $pdo->prepare('insert into cplx(lx) values(:ss)');
    $s->execute(array(
        'ss' => $tjcplx
    ));
}
?>
<html>
<head>
<title>Bootstrap 模板</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"
	charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="web/css/bootstrap.min.css" rel="stylesheet">
<script src="web/js/jquery-1.11.1.min.js"></script>
<script src="web/js/bootstrap.min.js"></script>
<!--[if lt IE 9]>
		<script src="js/html5shiv.js"></script>
		<script src="js/respond.min.js"></script>
		<![endif]-->
</head>
<body>
	<?php include 'dh.php'; ?>
	<div class="container">
		<div class="col-xs-2">
			<a href="cplxlb.php" class="btn btn-default btn-block">菜品类型列表</a>
			<a href="dcxt.php" class="btn btn-default btn-block">返回首页</a>
		</div>
		<div class="col-xs-4">
			<div class="panel panel-primary">
				<div class="panel-heading">
					<div class="panel-lilte">
						<span class="glyphicon glyphicon-plus">
							<b>添加菜品类型</b>
						</span>
					</div>
				</div>
				<div class="panel-body"></div>
				<form class="form-horizontal" method="post" action="#">
					<div class="form-group">
						<label class="control-label col-xs-3">类型名:</label>
						<div class="col-xs-8">
							<input class="form-control" required="required" placeholder="类型名"
								name="tjcplx" />
						</div>
					</div>
					<div class="form-group">
						<button class="btn btn-primary col-xs-3  col-xs-offset-4"
							type="submit">添加</button>
					</div>
				</form>
			</div>
		</div>
	</div>
</body>
</html>
